home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 October / enter-2005-10.iso / files / jedit42install.exe / {app} / jedit.jar / bsh / commands / rm.bsh < prev    next >
Encoding:
Text File  |  2003-12-27  |  353 b   |  22 lines

  1. /**
  2.     Remove a file (like Unix rm).
  3. */
  4.  
  5. bsh.help.rm = "usage: cd( path )";
  6.  
  7. boolean rm( String pathname ) 
  8. {
  9.     this.file = pathToFile( pathname );
  10.  
  11.     if ( file == null )
  12.         throw new java.io.FileNotFoundException("pathname");
  13.  
  14.     if ( file.isDirectory() ) {
  15.         print( pathname + "is a directory" );
  16.         return;
  17.     }
  18.  
  19.     return file.delete();
  20. }
  21.  
  22.